const path = require('path')
module.exports = {
  mode: "development",
  entry: './src/main.js',
  // 有26个值  development开发模式下一般是eval   production生产模式下一般是none/source-map(浏览器中还原最准确的代码)
  devtool: "source-map",
  output: {
    path: path.resolve(__dirname, './build'),
    filename: "bundel.js",
    clean: true
  },
  resolve: {
    extensions: [".js", ".vue", ".json", '.jsx', '.ts', '.tsx'],
    alias: {}
  },
  module: {
    rules: [
      {
        test: /\.(png|jpe?g|svg|gif)$/,
        type: "asset",
        parser: {
          dataUrlCoditon: {
            maxSize: 60 * 1024
          }
        },
        generator: {
          filename: "img/[name]_[hash:8].[ext]"
        }
      },
      {
        test: /\.js$/,
        use: {
          loader: 'babel-loader'
        }
      }
    ]
  },
  plugins: [

  ]
}